package com.phospherus.common.repository;

import com.phospherus.common.AttachedFile;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * @author songjinlong
 * @version 1.0
 * @since 2017/12/21
 */
public interface AttachedFileRepository extends BaseRepository<AttachedFile, Long> {
    @Query(value = "select * from attached_file where status=1 and type=2 and form_inst_id= :formInstId and tab_id= :tabId and tab_name= :tabName", nativeQuery = true)
    List<AttachedFile> getFormAttachedFiles(@Param("formInstId") Long formInstId, @Param("tabId") Long tabId, @Param("tabName") String tabName);
}
